package com.yongbao.model.util;

import com.yongbao.model.dtomapper.DishOrderSubDtoMapper;
import com.yongbao.model.domain.DishOrderSubDO;
import com.yongbao.model.vo.DishOrderSubVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class DishOrderSubConvert {

    public static List<DishOrderSubVO> buildDishOrderSubVoList(List<DishOrderSubDO> dishOrderSubDOList) {
        if (CollectionUtils.isEmpty(dishOrderSubDOList)) {
            return Lists.newArrayList();
        }
        List<DishOrderSubVO> dishOrderSubVOList = new ArrayList<>();
        for (DishOrderSubDO dishOrderSubDO : dishOrderSubDOList) {
            dishOrderSubVOList.add(DishOrderSubDtoMapper.INSTANCE.do2VO(dishOrderSubDO));
        }

        return dishOrderSubVOList;
    }
}
